In general, whenever a data value used during compression or coding is quantized, there is a need to distribute the now fewer possible values within the larger set of unquantized values. For instance, when trying to represent a value between 0 and 255 using only four bits, a mapping from the 24=16 possible values to the interval 0 to 255 must be constructed. A common approach within compression and in particular graphics is to store the most significant bits and then replicating them into the positions of the least significant bits during decompression or decoding. Thus, a data value of 240 could be represented by 1110bin using four bits, which after bit replication becomes 11101110bin=238dec. This leads to a representation where possible values are fairly evenly spaced in the interval and include both endpoints since replicating 0000bin yields 00000000bin=0dec and 1111bin becomes 11111111bin=255dec. FIG. 1A schematically illustrate this concept of even distribution of two data values that each can be represented by two bits.
Another possible approach would be to store the most significant bits but set the least significant bits to an average value, such as 1000bin or 0111bin for four bits. With this approach, the possible values are again evenly spaced in the interval but the endpoints are not included. This can lead to a slight improvement in the peak signal to noise ratio (PSNR) in some codecs but has the disadvantage of not being able to represent the endpoints of the interval exactly.
A shortcoming with these prior art techniques is that, when two data values are to be co-compressed and the number of bits to spend for each data value is fixed, it is not possible to adjust the accuracy of the two data values. For instance, the two data values could represent two color codewords of a texel block. For some texel blocks the first color codeword is most important, whereas for the other texel blocks the second color codeword is the most important one. However, since the number of bits to spend for the color codewords need to be fixed for all texel blocks it is not possible with the prior art techniques discussed above to improve the accuracy of one of the color codewords at the cost of the accuracy of the other color codeword.
A solution to this problem to sacrifice some accuracy in one of the data values for an increased accuracy in the other data value would be to lattice vector quantize the two data values. A lattice quantizer is generally constructed using the function:
      (                            x                                      y                      )    =            (                                    a                                b                                                c                                d                              )        ⁢          (                                    i                                                j                              )      where i and j are integers and (x,y) is the reconstruction point.
However, a problem when using a lattice quantizer is that decompression is rather complex since a matrix multiplication must be performed. Another drawback with lattice quantization is that not all values of i and j can be used since some values will lead to reconstruction points that fall outside of the allowable value interval. Hence, there will be a problem to find a simple mapping from the index of the reconstruction point to i and j and further an expensive matrix multiplication from (i,j) to get to (x,y). This problem is known as the truncation problem in the art.
There is therefore a need for a solution that allows efficient compression or quantization of data values that does not have the drawbacks of lattice vector quantization.